package com.zhanghe.mall.pojo;

import com.zhanghe.mall.pojo.common.BasePojo;

import javax.persistence.*;

@Entity
@Table(name = "commodity_classification_tree")
public class CommodityClassificationTree extends BasePojo {

    /**
     * 祖先,上级节点
     */
    @ManyToOne
    @JoinColumn(name="ancestor")
    public CommodityClassification ancestor;
    /**
     * 子代,下级节点
     */
    @ManyToOne
    @JoinColumn(name="descendant")
    public CommodityClassification descendant;
    /**
     * 子代到祖先的距离
     */
    public Long distance;

    public CommodityClassification getAncestor() {
        return ancestor;
    }

    public void setAncestor(CommodityClassification ancestor) {
        this.ancestor = ancestor;
    }

    public CommodityClassification getDescendant() {
        return descendant;
    }

    public void setDescendant(CommodityClassification descendant) {
        this.descendant = descendant;
    }

    public Long getDistance() {
        return distance;
    }

    public void setDistance(Long distance) {
        this.distance = distance;
    }

}
